package com.lut.edu.apm.commodityCenter.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lut.edu.apm.commodityCenter.pojo.CommodityOrder;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author Zhao Suzhen
 * @date `2024/4/13`
 */
@Mapper
public interface CommodityOrderMapper extends BaseMapper<CommodityOrder> {
    /**
     * 更新商品库存
     * @param barcode
     * @param reserve
     * @return
     */
    int updateReserve(String barcode, int reserve, String nowTime);

    /**
     * 支付后商品更新
     * @param barcode
     * @param reserve
     * @return
     */
    int updateReservePay(String barcode, int reserve);

    /**
     * 查询上新商品
     * @return
     */
    List<Map<String, Object>> selectNewProduct();
}
